/**
 *检查电话号码
 */
export const checkPhonenum = (phone)=>{
	return /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(phone)
}
export const checkIdcard = (idcard) =>{
	return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(idcard)
}
/*
* JSON数组去重
* @param: [array] json Array
* @param: [string] 唯一的key名，根据此键名进行去重
*/
export function uniqueArray(array, key){//json数组去重
	var result = [array[0]];
	for(var i = 1; i < array.length; i++){
	  var item = array[i];
	  var repeat = false;
	  for (var j = 0; j < result.length; j++) {
		if (item[key] == result[j][key]) {
		  repeat = true;
		  break;
		}
	  }
	  if (!repeat) {
		result.push(item);
	  }
	}
	return result;
  }